﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Common;

public class CreateRoomRequest : BaseRequest
{
    private MatchPanel matchPanel;

    public override void Awake()
    {
        requestCode = RequestCode.Room;
        actionCode = ActionCode.CreateRoom;
        matchPanel = GetComponent<MatchPanel>();
        base.Awake();
    }

    public override void SendRequest()
    {
        base.SendRequest("r");//r 并无实际意义，以免传入数据为空
    }

    public override void OnResponse(string data)
    {
        base.OnResponse(data);
        ReturnCode returnCode = (ReturnCode)int.Parse(data);
        if (returnCode == ReturnCode.Success)
        {
            matchPanel.SetLocalPlayerResSync();
        }
    }
}
